package com.ioc.demo.controller;

import com.ioc.demo.config.UserConfig;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 王圆豪
 * Date: 2025-07-03
 * Time: 20:29
 */
@Controller
//@AllArgsConstructor
//@NoArgsConstructor
//@Data
public class HelloController {
    //属性注入
//    @Autowired
    private UserConfig userConfig;
//    private UserComponent userComponent;



    //setter方法注入
//    @Autowired
//    public void setUserConfig(UserConfig userConfig) {
//        this.userConfig = userConfig;
//    }

//    public void setUserComponent(UserComponent userComponent) {
//        this.userComponent = userComponent;
//    }


    //构造方法注入
//    public HelloController() {}
//
//    @Autowired
//    public HelloController(UserConfig userConfig) {
//        this.userConfig = userConfig;
//    }

    public void print(){
        System.out.println("helloController");
        userConfig.print();
    }
}
